package com.truyen.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.truyen.persistence.dao.LoaiAnhDepDao;
import com.truyen.persistence.entity.LoaiAnhDep;
import com.truyen.service.LoaiAnhDepService;
import com.truyen.utils.PagingInfo;


@Service
public class LoaiAnhDepServiceImpl implements LoaiAnhDepService {
	
	@Autowired
	private LoaiAnhDepDao loaiAnhDepDao;

	@Override
	public void save(LoaiAnhDep entity) {
		loaiAnhDepDao.save(entity);
	}

	@Override
	public LoaiAnhDep findById(Long id) {
		return loaiAnhDepDao.findById(id);
	}

	@Override
	public List<LoaiAnhDep> getAll() {
		return loaiAnhDepDao.findAll();
	}

	@Override
	public LoaiAnhDep findByProperty(String column, Object value) {
		List<LoaiAnhDep> lst = loaiAnhDepDao.findByProperty(column, value);
		return (lst.size()>0)?lst.get(0):null;
	}

	@Override
	public List<LoaiAnhDep> getAllLst(String kwSearch, String sort, String sortBy,
			PagingInfo pInfo) {
		return loaiAnhDepDao.getAllLst(kwSearch,sort,sortBy,pInfo);
	}


}
